package com.fly.springbootTemplate.dao;

import com.fly.springbootTemplate.entity.Teacher;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface TeacherDao {
    //增加教师
    boolean insertTeacher(Teacher teacher);
    //删除教师
    boolean deleteTeacher(String teacherId);
    //修改教师
    boolean updateTeacher(Teacher teacher);
    //查询教师
    List<Teacher> selectAllTeacher();
    //通过id查询教师
    Teacher selectTeacherById(String teacherId);
    //模糊查询教师
    List<Teacher> selectTeacherByName(String teacherName);

    /*
     <!--  模糊搜索实现-->
        select * from t_teacher where teacher_name like "%${teacherName}%"
        --         <!-- 使用concat函数实现模糊搜索 -->
        --         select * from t_teacher where teacher_name like concat('%',#{teacherName},'%')
        --         <!--  模糊搜索实现方式二-->
        --         select * from t_teacher where teacher_name  like '%${teacherName}%'
        --         <!--  模糊搜索实现方式三-->
        --         select * from t_teacher where teacher_name  like '%'||#{teacherName}||'%' //有问题
        --         <!--  模糊搜索实现方式四-->
        --         select * from t_teacher where teacher_name_name like concat('%','${teacherName}','%')
     */
}
